//
// Created by xili on 2024/8/6 18:59.
// Go big or go home.
//
#include <iostream>
#include <vector>

using namespace std;

class Solution {
public:
    bool areOccurrencesEqual(string s) {
        vector<int> v(26, 0);
        for (auto &item: s) {
            v[item - 'a']++;
        }
        int p = v[s[0] - 'a'];
        for (int i = 1; i < 26; i++) {
            if (v[i] && v[i] != p) {
                return false;
            }
        }
        return true;
    }
};